If temprecord.sex <> 0 And temprecord.patid <> 0 Then
ok.idf = -1
smartform = -1
End If
Case 2
If temprecord.dayt <> "" And temprecord.tyme <> "" And temprecord.theoption.opt1 And temprecord.theoption.opt4 And temprecord.theoption.opt10 And temprecord.chk1 And temprecord.chk2 Then
ok.ass1 = -1
smartform = -1
End If
Case 3
If LTrim$(temprecord.name) <> "" And LTrim$(temprecord.relation) <> "" And LTrim$(temprecord.home) <> "" And LTrim$(temprecord.work) <> "" And LTrim$(temprecord.hed1) <> "" Then
ok.ass2 = -1
smartform = -1
End If
Case 4
ok.medh = -1
smartform = -1
Case 5
If picloc Then
ok.ass3 = -1
smartform = -1
End If
Case 6
If MDIChild1A.List1(1).ListCount > 0 And MDIChild1B.List2(1).ListCount > 0 And MDIChild1C.List3(1).ListCount > 0 Then
ok.mdif = -1
smartform = -1
End If
Case 7
If summary.List2.ListCount > 0 Then
ok.sumf = -1
smartform = -1
End If
End Select
Else
smartform = -1
End If
End Function
Function validID (IDstring As String) As Long
validID = 0
For n = 1 To Len(IDstring)
If Mid$(IDstring, n, 1) <> "-" Then
c$ = c$ + Mid$(IDstring, n, 1)
End If
Next
IDstring = c$
' Look for a match
For i = 1 To 3 'uses constants for testing
If Val(LTrim$(RTrim$(IDstring))) = patientID(i) Then
validID = patientID(i)
found = -1
Exit For
End If
Next i
If Not found Then
Open "health.dat" For Random As #1 Len = Len(patrecord)
numrecs = LOF(1) \ Len(patrecord)
For n = 1 To numrecs
Get #1, n, patrecord
If Val(LTrim$(RTrim$(IDstring))) = patrecord.patid Then
recindex = n
Exit For
End If
Next n
Close #1
If Val(LTrim$(RTrim$(IDstring))) = patrecord.patid Then